home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / MotifApp / ch5 / TicTacToe.h < prev   
Encoding:
C/C++ Source or Header  |  1995-05-03  |  1.9 KB  |  60 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //         This example code is from the book:
  4. //
  5. //           Object-Oriented Programming with C++ and OSF/Motif
  6. //         by
  7. //           Douglas Young
  8. //           Prentice Hall, 1992
  9. //           ISBN 0-13-630252-1    
  10. //
  11. //         Copyright 1991 by Prentice Hall
  12. //         All Rights Reserved
  13. //
  14. //  Permission to use, copy, modify, and distribute this software for 
  15. //  any purpose except publication and without fee is hereby granted, provided 
  16. //  that the above copyright notice appear in all copies of the software.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. ///////////////////////////////////////////////////////////////
  22. // TicTacToe.h: TicTacToe subsystem that encapsulates all
  23. //              major components of the game.
  24. ///////////////////////////////////////////////////////////////
  25. #ifndef TICTACTOE_H
  26. #define TICTACTOE_H
  27.  
  28. #include "UIComponent.h"
  29.  
  30. class GameBoard;
  31. class Message;
  32. class Command;
  33. class Engine;
  34.  
  35. class TicTacToe: public UIComponent {
  36.     
  37.   protected:
  38.     
  39.     // Pointers to the major UIComponents of TicTacToe
  40.     
  41.     GameBoard   *_gameBoard;
  42.     Message     *_msgArea;
  43.     Command     *_commandArea;
  44.     Engine      *_engine;
  45.     
  46.   public:
  47.     
  48.     TicTacToe ( Widget, char * ); 
  49.     virtual ~TicTacToe();
  50.     
  51.     // Access functions for each object in the game.
  52.     
  53.     GameBoard   *gameBoard()   const { return _gameBoard;   }
  54.     Message     *messageArea() const { return _msgArea;     }
  55.     Command     *commandArea() const { return _commandArea; }
  56.     Engine      *engine()      const { return _engine;      }
  57.     virtual const char* const className()  { return "TicTacToe"; }
  58. };
  59. #endif
  60.